﻿using System;

using System.Collections.Generic;
using System.Linq;
using System.Text;
using Lucene.Net.Search;
using LWrap.Entities;
namespace LWrap.Search
{
    public class SearchWord
    {
        public string IndexLocation { get; set; }
        public string BooleanCondition { get; set; }
        public string DefaultField { get; set; }
        public List<string> FieldValueInSearchResult { get; set; }

        public List<SearchResultList> Search(string booleanCondition,string indexLocation,string defaultField, List<string> fieldValueInSearchResult)
        {
            SearchBase search = new StandardSearch();
            search.DefaultField = defaultField;
            search.BooleanCondition = booleanCondition;
            search.IndexLocation = indexLocation;
            search.FieldValueInSearchResult = fieldValueInSearchResult;

            return search.ExecuteSearch();
        }

        public List<SearchResultList> Search()
        {
            return this.Search(this.BooleanCondition, this.IndexLocation, this.DefaultField, this.FieldValueInSearchResult);
        }
    }
}
